home *** CD-ROM | disk | FTP | other *** search
/ Scene 96 / Scene 96 International Edition (Zyklop Software) (Disc 2) (1997).iso / misc / coding / one_scrs / asm / sive2.asm < prev    next >
Encoding:
Assembly Source File  |  1996-07-19  |  42.0 KB  |  1,170 lines

  1. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  2. ;
  3. ; Shock integrated Virtual Video Engine (SIVE) 1.4
  4. ;
  5. ; Developed by Tsc/Shock! in 1995-96
  6. ;
  7. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  8. ;
  9. ; (Non) Linear Framebuffer & (Non) Truecolor Routines
  10. ;
  11. ; Hivetest        - Checking, Detecting, etc.
  12. ; Set640x480x8    - Sets real 640x480 (linear) mode
  13. ; Set640x480x24   - Sets real 640x480 linear truecolor mode
  14. ; Set320x200x24   - Sets real 320x200 linear truecolor mode
  15. ; Set320x200x24p  - Sets 320x200 linear pseudo-truecolor mode
  16. ; Set320x200x256  - Sets 320x200 256 color mode
  17. ; Disp320x200x24p - Displays a 320x200 pseudo-truecolor image
  18. ; Disp640x480x8   - Displays a 640x480x8 image
  19. ; Disp320x200x256 - Displays a 320x200x256 colors image
  20. ; Putlogo         - Adds a logo to a 320x200x256 image
  21. ; Setpal8         - Sets a 8 bit color palette
  22. ; Setpal8brighten - Sets a 8 bit color palette with 75% brightening
  23. ; Setpal4         - Sets a 4 bit color palette
  24. ; DarkenPal       - Clears the actual 8 bit pal
  25. ; Headermessy     - Writes the 'SIDE INIT...' text onto the screen
  26. ; Set80x25x16     - Sets dos textmode
  27. ; Clear256k       - Clears the whole 256k video mem
  28. ; MotionBlur      - Blurs the given bitmap
  29. ; Addpic          - Esi, Edi, Ecx - Adds two truecolor images
  30. ; Subpic          - Esi, Edi, Ecx - Subtracts two truecolor images
  31. ; ExchangeRB      - Esi, Ecx - Exchgs the Red and Blue components of the image
  32. ; Palmorph        - Morphs two palettes
  33. ; Rasterwait      - Guess what?
  34. ;
  35. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  36.  
  37.                 .386p
  38.                 .model flat, c
  39.                 locals
  40.                 .code
  41.  
  42.                 truecolor320    db 0    ;0 - 32bit truecolor, vbe2 linear
  43.                                         ;1 - 24bit truecolor, vbe2 linear
  44.                                         ;2 - pseudo, vbe2 linear
  45.                                         ;3 - pseudo, mode_x planar
  46.  
  47.                 needsvesa20     db 0    ;0 - nope
  48.                                         ;1 - yes
  49.  
  50. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  51.  
  52.  
  53.                 public  hivetest
  54.                 public  set640x480x8
  55.                 public  set640x480x24
  56.                 public  set320x200x24p
  57.                 public  set320x200x256
  58.                 public  set80x25x16
  59.                 public  setpal8
  60.                 public  setpal8brighten
  61.                 public  setpal4
  62.                 public  darkenpal
  63.                 public  disp640x480x8
  64.                 public  disp320x200x256
  65.                 public  exchangerb
  66.                 public  addpic
  67.                 public  subpic
  68.                 public  rasterwait
  69.                 public  palmorph
  70.                 public  putlogo
  71.                 public  clear256k
  72.                 public  motionblur
  73.                 public  motionblur2
  74.                 public  motionblur3
  75.                 public  motionblur4
  76.                 public  motionblur5
  77.                 public  headermessy
  78.  
  79.                 extrn   vesa_addy       :dword
  80.                 extrn   vesa_granularity:dword
  81.  
  82. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  83. ;
  84. ; Real Truecolor 640x480 routines for Watcom C protected mode
  85. ;
  86. ; by Tsc/Shock!
  87. ;
  88. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  89.  
  90. addpic:         pushad
  91.                 mov     eax,0
  92. addpicloop:     lodsb
  93.                 jz      addpicnuller
  94.                 movzx   ebx,byte ptr [edi]
  95.                 add     ebx,eax
  96.                 cmp     ebx,255
  97.                 ja      addpicoverflow
  98.                 add     [edi],al
  99.                 jmp     addpicnuller
  100. addpicoverflow: mov     byte ptr [edi],255
  101. addpicnuller:   inc     edi
  102.                 loop    addpicloop
  103.                 popad
  104.                 ret
  105.  
  106. subpic:         pushad
  107. subpicloop:     lodsb
  108.                 jz      subpicnuller
  109.                 cmp     al,byte ptr [edi]
  110.                 jae     subpicoverflow
  111.                 sub     byte ptr [edi],al
  112.                 jmp     subpicnuller
  113. subpicoverflow: mov     byte ptr [edi],0
  114. subpicnuller:   inc     edi
  115.                 loop    subpicloop
  116.                 popad
  117.                 ret
  118.  
  119. addbox:         pushad
  120.                 push    eax             ;esi - kep
  121.                 push    ebx             ;eax, ebx: x1,y1
  122.                 push    edx             ;ecx, edx: x2,y2
  123.                 xchg    eax,ebx
  124.                 mov     ebp,640
  125.                 mul     ebp
  126.                 add     eax,ebx         ;creating offset
  127.                 mov     ebp,3
  128.                 mul     ebp             ;mul by 3 becoz of truecolor mode
  129.                 add     esi,eax         ;got the final offset
  130.                 pop     edx
  131.                 pop     ebx
  132.                 pop     eax             ;back to the initial state ;)
  133.                 sub     ecx,eax
  134.                 sub     edx,ebx
  135.                 lea     ecx,[ecx+2*ecx] ;ecx=3*ecx
  136.                 xchg    edx,ecx
  137. addboxloop1:    push    ecx
  138.                 mov     ecx,edx
  139. addboxloop2:    shr     byte ptr [esi+ecx],1
  140.                 loop    addboxloop2
  141.                 shr     byte ptr [esi],1
  142.                 pop     ecx
  143.                 add     esi,640*3       ;should be *4 for 32bit color cards
  144.                 loop    addboxloop1
  145.                 popad
  146.                 ret
  147.  
  148. subbox:         pushad
  149.                 push    eax
  150.                 push    ebx
  151.                 push    edx
  152.                 xchg    eax,ebx
  153.                 mov     ebp,640
  154.                 mul     ebp
  155.                 add     eax,ebx         ;creating offset
  156.                 mov     ebp,3
  157.                 mul     ebp             ;mul by 3 becoz of truecolor mode
  158.                 add     esi,eax         ;got the final offset
  159.                 pop     edx
  160.                 pop     ebx
  161.                 pop     eax             ;back to the initial state ;)
  162.                 sub     ecx,eax
  163.                 sub     edx,ebx
  164.                 lea     ecx,[ecx+2*ecx] ;ecx=3*ecx
  165.                 xchg    edx,ecx
  166. subboxloop1:    push    ecx
  167.                 mov     ecx,edx
  168. subboxloop2:    shl     byte ptr [esi+ecx],1
  169.                 loop    subboxloop2
  170.                 shl     byte ptr [esi],1
  171.                 pop     ecx
  172.                 add     esi,640*3       ;should be *4 for 32bit color cards
  173.                 loop    subboxloop1
  174.                 popad
  175.                 ret
  176.  
  177. mem2screen24:   pushad
  178.                 mov     edi,vesa_addy
  179.                 mov     ecx,921600/4
  180.                 rep     movsd
  181.                 popad
  182.                 ret
  183.  
  184. exchangerb:     pushad
  185. exchloop:       mov     al,byte ptr [esi]
  186.                 xchg    al,byte ptr [esi+2]
  187.                 mov     byte ptr [esi],al
  188.                 add     esi,3
  189.                 sub     ecx,3
  190.                 jnz     exchloop
  191.                 popad
  192.                 ret
  193.  
  194. set640x480x8:   pushad
  195.                 cmp     vesa_addy,0
  196.                 jne     l640go
  197.                 mov     bx,101h
  198.                 mov     ax,4f02h
  199.                 int     10h
  200.                 cmp     al,4fh
  201.                 je      settok
  202.                 lea     edx,verror005
  203.                 jmp     hiveerror
  204.  
  205. l640go:         mov     bx,4101h
  206.                 jmp     vesamodeset
  207.  
  208. set640x480x24:  pushad
  209.                 mov     bx,4112h
  210.                 jmp     vesamodeset
  211.  
  212. vesamodeset:    mov     ax,4f02h
  213.                 int     10h
  214.                 cmp     al,4fh
  215.                 je      settok
  216.                 lea     edx,verror001           ; absolutely no vesa present
  217.                 jmp     hiveerror
  218. settok:         cmp     ah,0
  219.                 je      truesupp
  220.                 lea     edx,verror002           ; cant do linear frame buffering
  221.                 jmp     hiveerror
  222. truesupp:       popad
  223.                 ret
  224.  
  225. set80x25x16:    pushad
  226.                 mov     ax,3
  227.                 int     10h
  228.                 popad
  229.                 ret
  230.  
  231. hivetest:       pushad
  232.  
  233.                 jmp     notestingneeded
  234.  
  235.                 mov     ax,1600h             ; Windows alatt vagyunk ?
  236.                 int     2fh
  237.                 or      al,80h
  238.                 cmp     al,80h
  239.                 je      windowsok
  240.                 lea     edx,verror006
  241.                 jmp     hiveerror
  242. windowsok:      lea     edx,emmname
  243.                 mov     ax,3d00h
  244.                 int     21h
  245.                 jc      emsok
  246.                 lea     edx,verror007
  247.                 jmp     hiveerror
  248. emsok:          mov     ax,1687h
  249.                 int     2fh
  250.                 or      ax,ax
  251.                 jnz     dpmiok
  252.                 lea     edx,verror008
  253.                 jmp     hiveerror
  254. dpmiok:         smsw    ax
  255.                 test    al,1
  256.                 jnz     v86ok
  257.                 lea     edx,verror003
  258.                 jmp     hiveerror
  259. v86ok:
  260. notestingneeded:
  261.                 cmp     vesa_addy,0
  262.                 je      csaktweak
  263.                 mov     truecolor320,2
  264.                 jmp     conts
  265. csaktweak:      mov     truecolor320,3
  266. conts:
  267.                 ;call    siveasking
  268.                 popad
  269.                 ret
  270.  
  271. hiveerror:      mov     ax,3
  272.                 int     10h
  273.                 push    edx
  274.                 lea     edx,vesaerror1
  275.                 mov     ah,9
  276.                 int     21h
  277.                 pop     edx
  278.                 mov     ah,9
  279.                 int     21h
  280.                 lea     edx,vesaerror2
  281.                 mov     ah,9
  282.                 int     21h
  283.                 mov     ax,4c00h
  284.                 int     21h
  285.  
  286. siveasking:     lea     edx,siveasking0
  287.                 mov     ah,9
  288.                 int     21h
  289. setupredo:      mov     ax,0
  290.                 int     16h
  291.                 cmp     al,30h
  292.                 jb      setupredo
  293.                 cmp     al,33h
  294.                 ja      setupredo
  295.                 sub     al,30h
  296.                 mov     truecolor320,al
  297.                 ret
  298.  
  299. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  300. ;
  301. ; SVGA 8 bit routines for Watcom C protected mode
  302. ;
  303. ; by Tsc/Shock!
  304. ;
  305. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  306.  
  307. grantemp        dd      0
  308.  
  309. set320x200x256: pushad
  310.                 mov     ax,13h
  311.                 int     10h
  312.                 popad
  313.                 ret
  314.  
  315. disp320x200x256:mov     esi,[esp+4]
  316.                 mov     edi,0a0000h
  317.                 mov     ecx,16000
  318.                 rep     movsd
  319.                 ret
  320.  
  321. disp640x480x8:  mov     esi,[esp+4]
  322.                 cmp     vesa_addy,0
  323.                 je      dispvesa12
  324.                 mov     edi,vesa_addy
  325.                 mov     ecx,307200/4
  326.                 rep     movsd
  327.                 ret
  328.  
  329. dispvesa12:     xor     edx,edx
  330.                 mov     eax,64
  331.                 div     vesa_granularity
  332.                 mov     grantemp,eax
  333.                 mov     ecx,16384
  334.                 mov     eax,0
  335.                 call    vesa_640_loop
  336.                 mov     ecx,16384
  337.                 mov     eax,1
  338.                 call    vesa_640_loop
  339.                 mov     ecx,16384
  340.                 mov     eax,2
  341.                 call    vesa_640_loop
  342.                 mov     ecx,16384
  343.                 mov     eax,3
  344.                 call    vesa_640_loop
  345.                 mov     ecx,45056/4
  346.                 mov     eax,4
  347.                 call    vesa_640_loop
  348.                 ret
  349.  
  350. vesa_640_loop:  mul     grantemp
  351.                 mov     edx,eax
  352.                 mov     ebx,0
  353.                 mov     eax,4f05h
  354.                 int     10h
  355.                 mov     edi,0a0000h
  356.                 rep     movsd
  357.                 ret
  358.  
  359. setpal8:        mov     esi,[esp+4]
  360.                 mov     edx,3c8h
  361.                 mov     al,0
  362.                 out     dx,al
  363.                 inc     edx
  364.                 mov     ecx,768
  365.                 rep     outsb
  366.                 ret
  367.  
  368. setpal8brighten:mov     esi,[esp+4]
  369.                 mov     edx,3c8h
  370.                 mov     al,0
  371.                 out     dx,al
  372.                 inc     edx
  373.                 mov     ecx,768
  374. loopsetp8b:     lodsb
  375.                 movzx   eax,al
  376.                 movzx   ebx,al
  377.                 shr     ebx,1
  378.                 shl     eax,1
  379. ;                sub     eax,ebx
  380.                 cmp     eax,63
  381.                 jbe     oksizeax
  382.                 mov     eax,63
  383. oksizeax:       out     dx,al
  384.                 dec     ecx
  385.                 jnz     loopsetp8b
  386.                 ret
  387.  
  388. setpal4:        mov     esi,[esp+4]
  389.                 mov     edx,3c8h
  390.                 mov     al,0
  391.                 out     dx,al
  392.                 inc     edx
  393.                 mov     ecx,48
  394.                 rep     outsb
  395.                 ret
  396.  
  397. darkenpal:      mov     edx,3c8h
  398.                 mov     al,0
  399.                 out     dx,al
  400.                 inc     edx
  401.                 mov     al,0
  402.                 mov     ecx,768
  403. clrpl:          out     dx,al
  404.                 loop    clrpl
  405.                 ret
  406.  
  407. palmorph:       mov     esi,[esp+4]
  408.                 mov     edi,[esp+8]
  409.                 mov     ecx,0
  410. palmorpl:       mov     al,[esi+ecx]
  411.                 cmp     al,[edi+ecx]
  412.                 je      overmorph
  413.                 ja      amorph
  414.                 inc     byte ptr [esi+ecx]
  415.                 jmp     overmorph
  416. amorph:         dec     byte ptr [esi+ecx]
  417. overmorph:      inc     ecx
  418.                 cmp     ecx,768
  419.                 jne     palmorpl
  420.                 ret
  421.  
  422. ; putlogo(from_address,to_address,to_offset,x_size,y_size);
  423.  
  424. putlogo:        mov     esi,[esp+4]
  425.                 mov     edi,[esp+8]
  426.                 add     edi,[esp+12]
  427.                 mov     ebp,0
  428. yloop:          mov     ecx,0
  429. xloop:          mov     al,[esi+ecx]
  430.                 cmp     al,0
  431.                 je      noput
  432.                 mov     [edi+ecx],al
  433. noput:          inc     ecx
  434.                 cmp     ecx,[esp+16]
  435.                 jne     xloop
  436.                 add     edi,320
  437.                 add     esi,[esp+16]
  438.                 inc     ebp
  439.                 cmp     ebp,[esp+20]
  440.                 jne     yloop
  441.                 ret
  442.  
  443. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  444. ;
  445. ; Pseudo-Truecolor routines for Watcom C protected mode
  446. ;
  447. ; by Tsc/Shock!
  448. ;
  449. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  450.  
  451. set320x200x24p:
  452.                 cmp     truecolor320,3
  453.                 je      setxtrue
  454.                 cmp     truecolor320,2
  455.                 je      setltrue
  456.                 mov     ax,4f02h        ; vesa 320x200 linear truecolor mode
  457.                 mov     bx,410fh
  458.                 int     10h
  459.                 ret
  460. setltrue:       mov     ax,4f02h        ; vesa 320x400 linear 256 color mode
  461.                 mov     bx,4155h
  462.                 int     10h
  463. cont001:        mov     edx,3C8h
  464.                 mov     eax,0
  465.                 out     dx,al
  466.                 inc     edx
  467.                 mov     ecx,768
  468.                 lea     esi,truepal     ; setting palette for pseudo truecolor
  469.                 rep     outsb
  470.                 ret
  471.  
  472. setxtrue:       call    set320x400x256  ; mode_x 320x400 planar mode
  473.                 mov     edx,3C8h
  474.                 mov     eax,0
  475.                 out     dx,al
  476.                 inc     edx
  477.                 mov     ecx,768
  478.                 lea     esi,truepal     ; setting palette for pseudo truecolor
  479.                 rep     outsb
  480.                 ret
  481.  
  482. disp320x200x24p:
  483.                 pushad
  484.                 mov     esi,edi         ; ebp - picture (64000 bytes)
  485.                 cmp     truecolor320,3
  486.                 je      disptcx
  487.                 mov     edi,vesa_addy   ; esi - buffer (128000 bytes)
  488.                 cmp     truecolor320,2
  489.                 je      disptcl
  490.                 call    rasterwait
  491.                 mov     ecx,192000/4
  492.                 rep     movsd
  493.                 popad
  494.                 ret
  495. disptcl:        call    rasterwait
  496.                 mov     ecx,128000/4
  497.                 rep     movsd
  498.                 popad
  499.                 ret
  500.  
  501. disptcx:        call    disp320x400x256
  502.                 popad
  503.                 ret
  504.  
  505. mov320x200x24p: cmp     truecolor320,1
  506.                 je      mov320x200x24
  507.                 pushad
  508.                 mov     ecx,67
  509. truecalc1:      push    ecx
  510.                 mov     ecx,2
  511. truerow:        push    ecx
  512.                 mov     ecx,320/2
  513. truerowplus:    push    ecx
  514.  
  515.                 xor     ecx,ecx
  516.                 mov     cl,[ebp]
  517.                 lea     ecx,[ecx+2*ecx]
  518.                 mov     eax,dword ptr [esi+ecx]
  519.                 mov     dl,[edi+20]
  520.                 mov     [edi],al
  521.                 shr     eax,8
  522.                 or      ax,64+(256*128)
  523.                 mov     dl,[edi+320+20]
  524.                 mov     [edi+320],al
  525.                 inc     ebp
  526.                 mov     dl,[edi+640+20]
  527.                 mov     [edi+640],ah
  528.                 inc     edi
  529.  
  530.                 xor     ecx,ecx
  531.                 mov     cl,[ebp]
  532.                 lea     ecx,[ecx+2*ecx]
  533.                 mov     eax,dword ptr [esi+ecx]
  534.                 mov     dl,[edi+320+20]
  535.                 mov     [edi+320],al
  536.                 shr     eax,8
  537.                 or      ax,64+(256*128)
  538.                 mov     dl,[edi+320+320+20]
  539.                 mov     [edi+320+320],al
  540.                 inc     ebp
  541.                 mov     dl,[edi+640+320+20]
  542.                 mov     [edi+640+320],ah
  543.                 inc     edi
  544.  
  545.                 pop     ecx
  546.                 dec     ecx
  547.                 jnz     truerowplus
  548.                 add     edi,640
  549.                 pop     ecx
  550.                 dec     ecx
  551.                 jnz     truerow
  552.                 add     ebp,320
  553.                 pop     ecx
  554.                 dec     ecx
  555.                 jnz     truecalc1
  556.                 popad
  557.                 ret
  558.  
  559. add320x200x24p: cmp     truecolor320,1
  560.                 je      add320x200x24
  561.                 pushad
  562.                 mov     ecx,67
  563.                 xor     edx,edx
  564. truecalc2:      push    ecx
  565.                 mov     ecx,2
  566. truerow2:       push    ecx
  567.                 mov     ecx,320/2
  568. truerowplus2:   push    ecx
  569.                 xor     ecx,ecx
  570.                 mov     cl,[ebp]
  571.                 lea     ecx,[ecx+2*ecx]
  572.                 mov     eax,dword ptr [esi+ecx]
  573.                 mov     dl,[edi]
  574.                 lea     edx,[edx+2*edx]
  575.                 add     dl,al
  576.                 shr     dl,2
  577.                 mov     [edi],dl
  578.                 shr     eax,8
  579.                 mov     dl,[edi+320]
  580.                 and     dl,63
  581.                 lea     ebx,[edx+2*edx]
  582.                 add     bl,al
  583.                 shr     bl,2
  584.                 or      bl,64
  585.                 mov     dl,[edi+640]
  586.                 and     dl,127
  587.                 lea     edx,[edx+2*edx]
  588.                 add     dl,ah
  589.                 shr     dl,2
  590.                 or      dl,128
  591.                 xor     ecx,ecx
  592.                 mov     [edi+640],dl
  593.                 mov     cl,[ebp+1]
  594.                 lea     ecx,[ecx+2*ecx]
  595.                 mov     eax,[esi+ecx]
  596.                 mov     dl,[edi+320+1]
  597.                 lea     edx,[edx+2*edx]
  598.                 add     dl,al
  599.                 shr     dl,2
  600.                 mov     bh,dl
  601.                 mov     [edi+320],bx
  602.                 shr     eax,8
  603.                 mov     dl,[edi+640+1]
  604.                 and     dl,63
  605.                 lea     edx,[edx+2*edx]
  606.                 add     dl,al
  607.                 shr     dl,2
  608.                 or      dl,64
  609.                 mov     [edi+640+1],dl
  610.                 mov     dl,[edi+960+1]
  611.                 and     dl,127
  612.                 lea     edx,[edx+2*edx]
  613.                 add     dl,ah
  614.                 shr     dl,2
  615.                 or      dl,128
  616.                 mov     [edi+960+1],dl
  617.                 add     ebp,2
  618.                 add     edi,2
  619.                 pop     ecx
  620.                 dec     ecx
  621.                 jnz     truerowplus2
  622.                 add     edi,640
  623.                 pop     ecx
  624.                 dec     ecx
  625.                 jnz     truerow2
  626.                 add     ebp,320
  627.                 pop     ecx
  628.                 dec     ecx
  629.                 jnz     truecalc2
  630.                 popad
  631.                 ret
  632.  
  633. add320x200x24p2:cmp     truecolor320,1
  634.                 je      add320x200x24
  635.                 pushad
  636.                 mov     ecx,67
  637.                 xor     edx,edx
  638. truecalc22:     push    ecx
  639.                 mov     ecx,2
  640. truerow22:      push    ecx
  641.                 mov     ecx,320/2
  642. truerowplus22:  push    ecx
  643.                 xor     ecx,ecx
  644.                 mov     cl,[ebp]
  645.                 or      cl,cl
  646.                 je      bugjes1
  647.                 lea     ecx,[ecx+2*ecx]
  648.                 mov     eax,dword ptr [esi+ecx]
  649.                 mov     dl,[edi]
  650.                 lea     edx,[edx+2*edx]
  651.                 add     dl,al
  652.                 shr     dl,2
  653.                 mov     [edi],dl
  654.                 shr     eax,8
  655.                 mov     dl,[edi+320]
  656.                 and     dl,63
  657.                 lea     ebx,[edx+2*edx]
  658.                 add     bl,al
  659.                 shr     bl,2
  660.                 or      bl,64
  661.                 mov     dl,[edi+640]
  662.                 and     dl,127
  663.                 lea     edx,[edx+2*edx]
  664.                 add     dl,ah
  665.                 shr     dl,2
  666.                 or      dl,128
  667.                 xor     ecx,ecx
  668.                 mov     [edi+640],dl
  669. bugjes1:        mov     cl,[ebp+1]
  670.                 or      cl,cl
  671.                 je      bugjes2
  672.                 lea     ecx,[ecx+2*ecx]
  673.                 mov     eax,[esi+ecx]
  674.                 mov     dl,[edi+320+1]
  675.                 lea     edx,[edx+2*edx]
  676.                 add     dl,al
  677.                 shr     dl,2
  678.                 mov     bh,dl
  679.                 mov     [edi+320],bx
  680.                 shr     eax,8
  681.                 mov     dl,[edi+640+1]
  682.                 and     dl,63
  683.                 lea     edx,[edx+2*edx]
  684.                 add     dl,al
  685.                 shr     dl,2
  686.                 or      dl,64
  687.                 mov     [edi+640+1],dl
  688.                 mov     dl,[edi+960+1]
  689.                 and     dl,127
  690.                 lea     edx,[edx+2*edx]
  691.                 add     dl,ah
  692.                 shr     dl,2
  693.                 or      dl,128
  694.                 mov     [edi+960+1],dl
  695. bugjes2:        add     ebp,2
  696.                 add     edi,2
  697.                 pop     ecx
  698.                 dec     ecx
  699.                 jnz     truerowplus22
  700.                 add     edi,640
  701.                 pop     ecx
  702.                 dec     ecx
  703.                 jnz     truerow22
  704.                 add     ebp,320
  705.                 pop     ecx
  706.                 dec     ecx
  707.                 jnz     truecalc22
  708.                 popad
  709.                 ret
  710.  
  711. truepal:
  712. db 000h,000h,000h,001h,000h,000h,001h,000h,000h,003h
  713. db 000h,000h,004h,000h,000h,005h,000h,000h,006h,000h
  714. db 000h,007h,000h,000h,009h,000h,000h,00ah,000h,000h
  715. db 00bh,000h,000h,00ch,000h,000h,00dh,000h,000h,00fh
  716. db 000h,000h,010h,000h,000h,011h,000h,000h,012h,000h
  717. db 000h,013h,000h,000h,015h,000h,000h,016h,000h,000h
  718. db 017h,000h,000h,018h,000h,000h,01ah,000h,000h,01bh
  719. db 000h,000h,01ch,000h,000h,01dh,000h,000h,01eh,000h
  720. db 000h,020h,000h,000h,021h,000h,000h,022h,000h,000h
  721. db 023h,000h,000h,024h,000h,000h,026h,000h,000h,026h
  722. db 000h,000h,027h,000h,000h,028h,000h,000h,029h,000h
  723. db 000h,02ah,000h,000h,02ah,000h,000h,02bh,000h,000h
  724. db 02ch,000h,000h,02dh,000h,000h,02eh,000h,000h,02eh
  725. db 000h,000h,02fh,000h,000h,030h,000h,000h,031h,000h
  726. db 000h,032h,000h,000h,033h,000h,000h,033h,000h,000h
  727. db 034h,000h,000h,035h,000h,000h,036h,000h,000h,037h
  728. db 000h,000h,037h,000h,000h,038h,000h,000h,039h,000h
  729. db 000h,03ah,000h,000h,03bh,000h,000h,03bh,000h,000h
  730. db 03ch,000h,000h,03dh,000h,000h,03eh,000h,000h,03fh
  731. db 000h,000h,000h,000h,000h,000h,001h,000h,000h,001h
  732. db 000h,000h,003h,000h,000h,004h,000h,000h,005h,000h
  733. db 000h,006h,000h,000h,007h,000h,000h,009h,000h,000h
  734. db 00ah,000h,000h,00bh,000h,000h,00ch,000h,000h,00dh
  735. db 000h,000h,00fh,000h,000h,010h,000h,000h,011h,000h
  736. db 000h,012h,000h,000h,013h,000h,000h,015h,000h,000h
  737. db 016h,000h,000h,017h,000h,000h,018h,000h,000h,01ah
  738. db 000h,000h,01bh,000h,000h,01ch,000h,000h,01dh,000h
  739. db 000h,01eh,000h,000h,020h,000h,000h,021h,000h,000h
  740. db 022h,000h,000h,023h,000h,000h,024h,000h,000h,026h
  741. db 000h,000h,026h,000h,000h,027h,000h,000h,028h,000h
  742. db 000h,029h,000h,000h,02ah,000h,000h,02ah,000h,000h
  743. db 02bh,000h,000h,02ch,000h,000h,02dh,000h,000h,02eh
  744. db 000h,000h,02eh,000h,000h,02fh,000h,000h,030h,000h
  745. db 000h,031h,000h,000h,032h,000h,000h,033h,000h,000h
  746. db 033h,000h,000h,034h,000h,000h,035h,000h,000h,036h
  747. db 000h,000h,037h,000h,000h,037h,000h,000h,038h,000h
  748. db 000h,039h,000h,000h,03ah,000h,000h,03bh,000h,000h
  749. db 03bh,000h,000h,03ch,000h,000h,03dh,000h,000h,03eh
  750. db 000h,000h,03fh,000h,000h,000h,000h,000h,000h,001h
  751. db 000h,000h,001h,000h,000h,003h,000h,000h,004h,000h
  752. db 000h,005h,000h,000h,006h,000h,000h,007h,000h,000h
  753. db 009h,000h,000h,00ah,000h,000h,00bh,000h,000h,00ch
  754. db 000h,000h,00dh,000h,000h,00fh,000h,000h,010h,000h
  755. db 000h,011h,000h,000h,012h,000h,000h,013h,000h,000h
  756. db 015h,000h,000h,016h,000h,000h,017h,000h,000h,018h
  757. db 000h,000h,01ah,000h,000h,01bh,000h,000h,01ch,000h
  758. db 000h,01dh,000h,000h,01eh,000h,000h,020h,000h,000h
  759. db 021h,000h,000h,022h,000h,000h,023h,000h,000h,024h
  760. db 000h,000h,026h,000h,000h,026h,000h,000h,027h,000h
  761. db 000h,028h,000h,000h,029h,000h,000h,02ah,000h,000h
  762. db 02ah,000h,000h,02bh,000h,000h,02ch,000h,000h,02dh
  763. db 000h,000h,02eh,000h,000h,02eh,000h,000h,02fh,000h
  764. db 000h,030h,000h,000h,031h,000h,000h,032h,000h,000h
  765. db 033h,000h,000h,033h,000h,000h,034h,000h,000h,035h
  766. db 000h,000h,036h,000h,000h,037h,000h,000h,037h,000h
  767. db 000h,038h,000h,000h,039h,000h,000h,03ah,000h,000h
  768. db 03bh,000h,000h,03bh,000h,000h,03ch,000h,000h,03dh
  769. db 000h,000h,03eh,000h,000h,03fh
  770. db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h
  771. db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h
  772. db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h
  773. db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h
  774. db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h
  775. db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h
  776. db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h
  777. db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h
  778. db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h
  779. db 000h,000h,000h,000h,000h,000h,03fh,03fh,03fh,03dh
  780. db 03dh,03dh,03ah,03ah,03ah,038h,038h,038h,036h,036h
  781. db 036h,034h,034h,034h,032h,032h,032h,030h,030h,030h
  782. db 02eh,02eh,02eh,02ch,02ch,02ch,029h,029h,029h,027h
  783. db 027h,027h,025h,025h,025h,023h,023h,023h,021h,021h
  784. db 021h,01fh,01fh,01fh,01dh,01dh,01dh,01bh,01bh,01bh
  785. db 018h,018h,018h,016h,016h,016h,014h,014h,014h,012h
  786. db 012h,012h,010h,010h,010h,00eh,00eh,00eh,00ch,00ch
  787. db 00ch,00ah,00ah,00ah,007h,007h,007h,005h,005h,005h
  788. db 003h,003h,003h,001h,001h,001h,000h,000h,000h,03fh
  789. db 03fh,03fh
  790.  
  791. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  792. ;
  793. ; Real truecolor 320x200 mode routines for Watcom C protected mode
  794. ;
  795. ; by Tsc/Shock!
  796. ;
  797. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  798.  
  799. mov320x200x24:  pushad
  800.                 mov     ecx,320*200
  801. tc320rowloop:   push    ecx
  802.                 xor     ecx,ecx
  803.                 mov     cl,[ebp]
  804.                 lea     ecx,[ecx+2*ecx]
  805.                 mov     eax,dword ptr [esi+ecx]
  806.                 xchg    al,ah
  807.                 shl     eax,2
  808.                 mov     [edi],eax
  809.                 inc     ebp
  810.                 add     edi,3
  811.                 pop     ecx
  812.                 dec     ecx
  813.                 jnz     tc320rowloop
  814.                 popad
  815.                 ret
  816.  
  817. add320x200x24:  pushad
  818.                 mov     ecx,320*200
  819. addrealtcloop:  push    ecx
  820.                 xor     ecx,ecx
  821.                 mov     cl,[ebp]
  822.                 lea     ecx,[ecx+2*ecx]
  823.                 mov     eax,dword ptr [esi+ecx]
  824.                 xor     edx,edx
  825.                 mov     dl,[edi+1]
  826.                 shr     dl,2
  827.                 lea     ecx,[edx+2*edx]
  828.                 add     cl,al
  829.                 mov     ch,cl
  830.                 shr     eax,8
  831.                 xor     edx,edx
  832.                 mov     dl,byte ptr[edi]
  833.                 shr     dl,2
  834.                 lea     edx,[edx+2*edx]
  835.                 add     dl,al
  836.                 mov     cl,dl
  837.                 xor     edx,edx
  838.                 mov     dl,byte ptr[edi+2]
  839.                 shr     dl,2
  840.                 lea     edx,[edx+2*edx]
  841.                 add     dl,ah
  842.                 mov     [edi],cx
  843.                 mov     [edi+2],dl
  844.                 add     edi,3
  845.                 inc     ebp
  846.                 pop     ecx
  847.                 dec     ecx
  848.                 jnz     addrealtcloop
  849.                 popad
  850.                 ret
  851.  
  852. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  853. ;
  854. ; Mode_X routines for Watcom C protected mode
  855. ;
  856. ; by Tsc/Shock!
  857. ;
  858. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  859.  
  860. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒ Sequencer registers ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  861.  
  862.                 Seq_Index   =  3C4h      ; Sequencer Registers Adress
  863.                 CrtC_Index  =  3D4h      ; CRTC Adress Register
  864.                 Graph_Index =  3CEh      ; Graphics Adress Register
  865.                 Attr_Index  =  3C0h      ; Atribute Controller Write
  866.                 Misc_Output =  3C2h      ; Miscellaneous Output Register
  867.  
  868. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒ Plane definitions ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  869.  
  870.                 PLANE_0     =  0102h
  871.                 PLANE_1     =  0202h
  872.                 PLANE_2     =  0402h
  873.                 PLANE_3     =  0802h
  874.                 ALL_PLANES  =  0F02h
  875.                 READ_PLANE_0=  0004h
  876.                 READ_PLANE_1=  0104h
  877.                 READ_PLANE_2=  0204h
  878.                 READ_PLANE_3=  0304h
  879.  
  880. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒ Mode definitions ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  881.  
  882. Label data320x400x256
  883.                 DW      04009h           ; Cellheight (1)
  884.                 DW      00014h           ; Underline Location (disable dword mode)
  885.                 DW      0e317h           ; Mode Control (enable byte mode)
  886.  
  887. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒ Mode settings ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  888.  
  889. set320x400x256:
  890.                 pushad
  891.                 mov     ax,0013h         ; Videomode 13h  320*200*256
  892.                 int     10h              ; Set the mode
  893.                 mov     dx,Seq_Index     ; Sequencer Address Register
  894.                 mov     al,04h           ; Index 4 - Memory mode
  895.                 out     dx,al
  896.                 inc     dx               ; 03c5h - Data register => set the mem mode here
  897.                 in      al,dx
  898.                 and     al,11110111b     ; Disable 3rd bit will give us unchained memory
  899.                 or      al,00000100b     ; Bit 2 enabled => no odd/even-scheme
  900.                 out     dx,al
  901.                 cld                      ; Clear direction flag (si increased)
  902.                 xor     ax,ax            ; Empty ax
  903.                 mov     dx,CrtC_Index    ; Port 03d4h
  904.                 mov     cx,3             ; Number of entries
  905.                 lea     esi,data320x400x256
  906. ParamLoop:      lodsw                    ; Load pair of index/data values
  907.                 out     dx,ax            ; Out them to CrtC Register
  908.                 loop    ParamLoop
  909.                 mov     dx,Seq_Index     ; Select port 03c4h
  910.                 mov     ax,00f02h        ; Map Mask Register (select all planes)
  911.                 out     dx,ax
  912.                 mov     edi,0a0000h      ; Set es:di to point to screenmem  di=0
  913.                 xor     eax,eax          ; Color to store = usually black = 0
  914.                 mov     cx,16384         ; 32768 (words) * 2 = 65536 bytes = 1 plane
  915.                 cld                      ; Clear dirflag => di is increased
  916.                 rep     stosd            ; Clear all 4 planes using wordwrites
  917.                 popad
  918.                 ret
  919.  
  920. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒ Clearing the whole video memory ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  921.  
  922. clear256k:      pushad
  923.                 mov     dx,Seq_Index     ; Select port 03c4h
  924.                 mov     ax,00f02h        ; Map Mask Register (select all planes)
  925.                 out     dx,ax
  926.                 mov     edi,0a0000h      ; Set es:di to point to screenmem  di=0
  927.                 xor     eax,eax          ; Color to store = usually black = 0
  928.                 mov     cx,16384         ; 32768 (words) * 2 = 65536 bytes = 1 plane
  929.                 cld                      ; Clear dirflag => di is increased
  930.                 rep     stosd            ; Clear all 4 planes using wordwrites
  931.                 popad
  932.                 ret
  933.  
  934. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒ Displaying ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  935.  
  936. actscreen       dd      0
  937.  
  938. disp320x400x256:pushad
  939.                 mov     eax,actscreen
  940.                 mov     dx,3d4h
  941.                 mov     ah,al
  942.                 mov     al,0dh
  943.                 out     dx,ax
  944.                 mov     eax,actscreen
  945.                 mov     al,0ch
  946.                 out     dx,ax
  947.                 xor     actscreen,8000h
  948.                 mov     ebp,esi
  949.                 call    rasterwait
  950.                 mov     dx,Seq_Index
  951.                 mov     ax,PLANE_0
  952.                 call    oneplane
  953.                 mov     ax,PLANE_1
  954.                 inc     ebp
  955.                 call    oneplane
  956.                 mov     ax,PLANE_2
  957.                 inc     ebp
  958.                 call    oneplane
  959.                 mov     ax,PLANE_3
  960.                 inc     ebp
  961.                 call    oneplane
  962.                 popad
  963.                 ret
  964.  
  965. oneplane:       out     dx,ax
  966.                 mov     esi,ebp
  967.                 mov     edi,0a0000h
  968.                 add     edi,actscreen
  969.                 mov     ecx,8000
  970. dlo1:           mov     al,[esi]
  971.                 mov     ah,[esi+4]
  972.                 shl     eax,16
  973.                 mov     al,[esi+8]
  974.                 mov     ah,[esi+12]
  975.                 rol     eax,16
  976.                 mov     [edi],eax
  977.                 add     edi,4
  978.                 add     esi,16
  979.                 dec     ecx
  980.                 jnz     dlo1
  981.                 ret
  982.  
  983. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒ Motion Blur Genya ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  984.  
  985. extrn   blurcolors:byte
  986. extrn   blurcolors2:byte
  987. extrn   blurcolors3:byte
  988. extrn   blurcolors4:byte
  989. extrn   blurcolors5:byte
  990. extrn   toscreen:dword
  991.  
  992. motionblur:     mov     edi,[esp+4]
  993.                 mov     ecx,32000
  994.                 lea     esi,toscreen
  995.                 xor     eax,eax
  996.                 lea     ebp,blurcolors
  997. nextpixel:      mov     ah,[edi]
  998.                 mov     al,[esi]
  999.                 mov     bl,[ebp+eax]
  1000.                 mov     ah,[edi+1]
  1001.                 mov     al,[esi+1]
  1002.                 mov     bh,[ebp+eax]
  1003.                 mov     [esi],bx
  1004.                 add     esi,2
  1005.                 add     edi,2
  1006.                 dec     cx
  1007.                 jnz     nextpixel
  1008.                 ret
  1009.  
  1010. motionblur2:    mov     edi,[esp+4]
  1011.                 mov     ecx,32000
  1012.                 lea     esi,toscreen
  1013.                 xor     eax,eax
  1014.                 lea     ebp,blurcolors2
  1015. nextpixel2:     mov     ah,[edi]
  1016.                 mov     al,[esi]
  1017.                 mov     bl,[ebp+eax]
  1018.                 mov     ah,[edi+1]
  1019.                 mov     al,[esi+1]
  1020.                 mov     bh,[ebp+eax]
  1021.                 mov     [esi],bx
  1022.                 add     esi,2
  1023.                 add     edi,2
  1024.                 dec     cx
  1025.                 jnz     nextpixel2
  1026.                 ret
  1027.  
  1028. motionblur3:    mov     edi,[esp+4]
  1029.                 mov     ecx,32000
  1030.                 lea     esi,toscreen
  1031.                 xor     eax,eax
  1032.                 lea     ebp,blurcolors3
  1033. nextpixel3:     mov     ah,[edi]
  1034.                 mov     al,[esi]
  1035.                 mov     bl,[ebp+eax]
  1036.                 mov     ah,[edi+1]
  1037.                 mov     al,[esi+1]
  1038.                 mov     bh,[ebp+eax]
  1039.                 mov     [esi],bx
  1040.                 add     esi,2
  1041.                 add     edi,2
  1042.                 dec     cx
  1043.                 jnz     nextpixel3
  1044.                 ret
  1045.  
  1046. motionblur4:    mov     edi,[esp+4]
  1047.                 mov     ecx,32000
  1048.                 lea     esi,toscreen
  1049.                 xor     eax,eax
  1050.                 lea     ebp,blurcolors4
  1051. nextpixel4:     mov     ah,[edi]
  1052.                 mov     al,[esi]
  1053.                 mov     bl,[ebp+eax]
  1054.                 mov     ah,[edi+1]
  1055.                 mov     al,[esi+1]
  1056.                 mov     bh,[ebp+eax]
  1057.                 mov     [esi],bx
  1058.                 add     esi,2
  1059.                 add     edi,2
  1060.                 dec     cx
  1061.                 jnz     nextpixel4
  1062.                 ret
  1063.  
  1064. motionblur5:    mov     edi,[esp+4]
  1065.                 mov     ecx,32000
  1066.                 lea     esi,toscreen
  1067.                 xor     eax,eax
  1068.                 lea     ebp,blurcolors5
  1069. nextpixel5:     mov     ah,[edi]
  1070.                 mov     al,[esi]
  1071.                 mov     bl,[ebp+eax]
  1072.                 mov     ah,[edi+1]
  1073.                 mov     al,[esi+1]
  1074.                 mov     bh,[ebp+eax]
  1075.                 mov     [esi],bx
  1076.                 add     esi,2
  1077.                 add     edi,2
  1078.                 dec     cx
  1079.                 jnz     nextpixel5
  1080.                 ret
  1081.  
  1082. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒ Other Routines ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  1083.  
  1084. rasterwait:     push    ax dx            ;ez a rutin megvárja, hogy
  1085.                 mov     dx,3dah          ;az elektronsugár a képernyô
  1086. ras11:          in      al,dx            ;tetejéhez érjen
  1087.                 and     al,8
  1088.                 je      ras11
  1089. ras22:          in      al,dx
  1090.                 and     al,1
  1091.                 je      ras22
  1092.                 pop     dx ax
  1093.                 ret
  1094.  
  1095. ki:             push    ax dx
  1096.                 mov     dx,3c8h
  1097.                 mov     al,0
  1098.                 out     dx,al
  1099.                 inc     dx
  1100.                 mov     al,0
  1101.                 out     dx,al
  1102.                 out     dx,al
  1103.                 out     dx,al
  1104.                 pop     dx ax
  1105.                 ret
  1106.  
  1107. be:             push    ax dx
  1108.                 mov     dx,3c8h
  1109.                 mov     al,0
  1110.                 out     dx,al
  1111.                 inc     dx
  1112.                 mov     al,0
  1113.                 out     dx,al
  1114.                 out     dx,al
  1115.                 mov     al,63
  1116.                 out     dx,al
  1117.                 pop     dx ax
  1118.                 ret
  1119.  
  1120. headermessy:    pushad
  1121.                 mov     ax,3
  1122.                 int     10h
  1123.                 mov     edi,0b8000h
  1124.                 lea     esi,headermessage
  1125.                 mov     ecx,80
  1126. hdrloop:        lodsb
  1127.                 stosb
  1128.                 mov     al,5Dh
  1129.                 stosb
  1130.                 dec     ecx
  1131.                 jnz     hdrloop
  1132.                 popad
  1133.                 ret
  1134.  
  1135. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒ Data & Messages ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  1136.  
  1137. emmname         db      'EMMXXXX0',0
  1138.  
  1139. headermessage   db      'SHOCK INTEGRATED DEMO ENGINE (SIDE) 1.4 INITIALIZATION IN PROGRESS, PLEASE WAIT!'
  1140.  
  1141. vesaerror1      db      '╔══════════════════════════════════════════════════════════════════════════════╗'
  1142.                 db      '║          Shock Integrated Virtual Video Engine (SIVE) error message:         ║'
  1143.                 db      '╠══════════════════════════════════════════════════════════════════════════════╣'
  1144.                 db      '║                                                                              ║','$'
  1145. verror001       db      '║            Vesa 2.0 or higher not detected. Please install UNIVBE!           ║','$'
  1146. verror002       db      '║            Your videocard does not support linear frame buffering!           ║'
  1147.                 db      '║        Please load UNIVBE first, that will probably solve the problem.       ║','$'
  1148. verror003       db      '║   Your system is already in V86 mode! Linear frame buffering is impossible!  ║','$'
  1149. verror004       db      '║               Your videocard does not support true color modes!              ║','$'
  1150. verror005       db      '║                  Not enough video memory for requested mode!                 ║','$'
  1151. verror006       db      '║        This software is not able to run under Microsoft Windows (tm)!        ║','$'
  1152. verror007       db      '║ You have to remove your EMM manager to make linear frame buffering possible! ║','$'
  1153. verror008       db      '║  You must remove your DPMI manager to make linear frame buffering possible!  ║','$'
  1154. vesaerror2      db      '║                                                                              ║'
  1155.                 db      '╚══════════════════════════════════════════════════════════════════════════════╝','$'
  1156. siveasking0     db      '╔══════════════════════════════════════════════════════════════════════════════╗'
  1157.                 db      '║         Shock Integrated Virtual Video Engine (SIVE) Initialization:         ║'
  1158.                 db      '╠══════════════════════════════════════════════════════════════════════════════╣'
  1159.                 db      '║                                                                              ║'
  1160.                 db      '║ Key  Res.  Colors  Hardware Requirements [+ pentium 12o cpu assumed - hehe]  ║'
  1161.                 db      '║                                                                              ║'
  1162.                 db      '║  0. 320x200 32bit  UniVBE, 32bit color vga card (like S3), linear fr.buffer  ║'
  1163.                 db      '║  1. 320x200 24bit  UniVBE, 24bit color vga card (generic), linear fr.buffer  ║'
  1164.                 db      '║  2. 320x200 18bit  UniVBE, 256 color vga card (hehe), linear fr. buffer      ║'
  1165.                 db      '║  3. 320x200 18bit  Will run on any vga card, but rather slow...              ║'
  1166.                 db      '║                                                                              ║'
  1167.                 db      '╚══════════════════════════════════════════════════════════════════════════════╝','$'
  1168.  
  1169.                 end
  1170.